package com.axin.oss.api.dto;

import com.axin.common.core.validate.AddGroup;
import com.axin.common.core.validate.EditGroup;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 对象存储配置业务对象 sys_oss_config
 *
 * @Author axin
 * @Date 2021/11/4 11:04
 **/
@Data
public class SysOssConfigDTO {


    /**
     * 主建
     */
    @NotNull(message = "主键不能为空", groups = { EditGroup.class })
    private Long ossConfigId;

    /**
     * 配置key
     */
    @NotBlank(message = "configKey不能为空", groups = { AddGroup.class, EditGroup.class })
    @Size(min = 2, max = 100, message = "configKey长度必须介于2和20 之间")
    private String configKey;

    /**
     * accessKey
     */
    @NotBlank(message = "accessKey不能为空", groups = { AddGroup.class, EditGroup.class })
    @Size(min = 2, max = 100, message = "accessKey长度必须介于2和100 之间")
    private String accessKey;

    /**
     * 秘钥
     */
    @NotBlank(message = "secretKey不能为空", groups = { AddGroup.class, EditGroup.class })
    @Size(min = 2, max = 100, message = "secretKey长度必须介于2和100 之间")
    private String secretKey;

    /**
     * 桶名称
     */
    @NotBlank(message = "bucketName不能为空", groups = { AddGroup.class, EditGroup.class })
    @Size(min = 2, max = 100, message = "bucketName长度必须介于2和100之间")
    private String bucketName;

    /**
     * 前缀
     */
    private String prefix;

    /**
     * 访问站点
     */
    @NotBlank(message = "endpoint不能为空", groups = { AddGroup.class, EditGroup.class })
    @Size(min = 2, max = 100, message = "endpoint长度必须介于2和100之间")
    private String endpoint;

    /**
     * 是否https（Y=是,N=否）
     */
    private String isHttps;

    /**
     * 状态（0=停用,1=正常）
     */
    private String status;

    /**
     * 域
     */
    private String region;


    /**
     * 分页大小
     */
    private Integer pageSize;

    /**
     * 当前页数
     */
    private Integer pageNum;

    /**
     * 排序列
     */
    private String orderByColumn;

    /**
     * 排序的方向desc或者asc
     */
    private String isAsc;
}
